//@author A0083782W

//CurrentTime is a class for you to get the current time
//It has already included the TECommonFunction.h
//It uses some of the features inside the TECommonFunction.h
//So please make sure that the above mentioned headerfile is present.
//It is faster than that of the function inside GetCurrentTimeFunctions namespace
//But it incurs larger memory usage.
//Use accordingly
//Some instruction:
//When you create a object of CurrentTime class, it will store the time
//when it is created.
//You can use getCurrenTime() method to get the respective time
//If you want to get the new time later, update() before usage.
//E.g.
//At 9:00am, you do the following code to get the current minute:
//CurrentTime aClock();
//currentMinute = aClock.getCurrentTime (TimeType::MINUTE);
//This class is not destroyed, at 9:15am you want to know the new time,
//then you should do the following code:
//aClock.update();
//currentMinute = aClock.getCurrentTime (TimeType::MINUTE);
//
//Note: 26/2/2014: Now the class can tell the current day of week as well. 

#pragma once
#include <ctime>
#include "TECommonFunctions.h"

using std::time_t;
using std::tm;
using std::time;
using GetCurrentTimeFunctions::TimeType;
using CommonDataType::ByteInt;

class CurrentTime {
public:
	CurrentTime(void);
	void update();
	ByteInt getCurrentTime(TimeType) const;

private:
	time_t t;
	struct tm now;
};

